package chap10collection.test20;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author zdl
 * @date 2024/12/17
 */
public class Demo20 {
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("Hello");
        list.add("World");
        list.add("Learn"); //此时 list 为 Hello World Learn
        //调用 reverseList 方法之后，list 为 Learn World Hello
        reverseList(list);
        System.out.println(list);
    }
    public static void reverseList(List list){
        Collections.reverse(list);
    }
}
